﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Administrator
{
    public partial class ucDeviceCE : UserControl
    {
        private Boolean LoadSetting = false; 
        public String CECaption = "";
        public Int32 CEChannel = 0;
        
        public ucDeviceCE()
        {
            InitializeComponent();
        }

        public void FillFields(String Caption, Int32 Channel)
        {
            CECaption = Caption;
            CEChannel = Channel;
            
            LoadSetting = true;
            tbCaption.Text = Caption;
            nudChannel.Value = Channel + 1;
            LoadSetting = false;
        }
        private void tbCaption_TextChanged(object sender, EventArgs e)
        {
            if (!LoadSetting) CECaption = tbCaption.Text;
        }
        private void nudChannel_ValueChanged(object sender, EventArgs e)
        {
            if (!LoadSetting) CEChannel = (Int32)(nudChannel.Value - 1);
        }
    }
}
